https://leetcode.cn/problems/letter-case-permutation/
class Solution {
public:
    vector<string> ret;
    string path;

    void dfs(string& s,int pos)
    {
        if(pos==s.size())
        {
            ret.push_back(path);
            return ;
        }

        //不改变
        char ch=s[pos];
        path+=ch;
        dfs(s,pos+1);
        path.pop_back();

        if(isalpha(ch))
        {
            path+=change(ch);
            dfs(s,pos+1);
            path.pop_back();
        }
    
    }

    vector<string> letterCasePermutation(string& s) {
        dfs(s,0);
        return ret;
    }


    char change(char ch)
    {
        if(ch >= 'a' && ch <= 'z') ch -= 32;
        else ch += 32;
        return ch;
    }
};